package com.yangbwe.Springtest.autowired;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Data
//component是用来创建对象的,对象名叫mystudent,只会创建一个,创建完成后会放在容器中
@Component("MyStudnet")
public class Student {
    @Value("张三")
    private  String name;
    @Value("12")
    private   int age;

    @Autowired
    private School school;
}
